using System.Collections.Generic;
using System.Threading.Tasks;
using CPlatePrintSys.Domain.Models;

namespace CPlatePrintSys.Domain.Services
{
    /// <summary>
    /// 布局服务接口
    /// </summary>
    public interface ILayoutService
    {
        /// <summary>
        /// 执行镜像自动布局
        /// </summary>
        /// <param name="plateAnnotationInfos">标注信息列表</param>
        /// <returns>布局结果</returns>
        Task<bool> ExecuteMirrorAutoLayoutAsync(List<PlateAnnotationInfo> plateAnnotationInfos);

        /// <summary>
        /// 执行手动合并布局
        /// </summary>
        /// <param name="selectedInfos">选中的标注信息</param>
        /// <param name="sheetLength">钢板长度</param>
        /// <param name="sheetWidth">钢板宽度</param>
        /// <returns>布局结果</returns>
        Task<bool> ExecuteManualMergeLayoutAsync(List<PlateAnnotationInfo> selectedInfos, double sheetLength, double sheetWidth);

        /// <summary>
        /// 验证合并布局是否可行
        /// </summary>
        /// <param name="selectedInfos">选中的标注信息</param>
        /// <param name="sheetLength">钢板长度</param>
        /// <param name="sheetWidth">钢板宽度</param>
        /// <returns>验证结果</returns>
        Task<(bool IsValid, string ErrorMessage)> ValidateMergeLayoutAsync(List<PlateAnnotationInfo> selectedInfos, double sheetLength, double sheetWidth);

        /// <summary>
        /// 从DXF文件中提取镜像信息
        /// </summary>
        /// <param name="dxfFilePath">DXF文件路径</param>
        /// <returns>镜像信息</returns>
        Task<MirroredLayout> ExtractMirrorInfoFromDxfAsync(string dxfFilePath);

        /// <summary>
        /// 计算合并布局的零件位置
        /// </summary>
        /// <param name="selectedInfos">选中的标注信息</param>
        /// <param name="sheetLength">钢板长度</param>
        /// <param name="sheetWidth">钢板宽度</param>
        /// <returns>合并布局信息</returns>
        Task<MergedLayout> CalculateMergeLayoutAsync(List<PlateAnnotationInfo> selectedInfos, double sheetLength, double sheetWidth);
    }
} 